home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / PC Card Manager / CIncludes / Power.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-25  |  33.8 KB  |  1,094 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Power.h
  3.  
  4.      Contains:    Power Manager Interfaces.
  5.  
  6.      Version:    System 7.5
  7.  
  8.      DRI:        Mike Hanlon
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            Dave Falkenburg
  17.                  With Interfacer:    2.0d13   (PowerPC native)
  18.                  From:                Power.i
  19.                      Revision:        45
  20.                      Dated:            10/8/96
  21.                      Last change by:    CSS
  22.                      Last comment:    Add pmChargeStatusChanged and hasChargeNotification for
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __POWER__
  29. #define __POWER__
  30.  
  31. #ifndef __TYPES__
  32. #include <Types.h>
  33. #endif
  34. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  35. #ifndef __MIXEDMODE__
  36. #include <MixedMode.h>
  37. #endif
  38. #endif
  39. #if FOR_SYSTEM8_PREEMPTIVE
  40. #ifndef __KERNEL__
  41. #include <Kernel.h>
  42. #endif
  43. #ifndef __NAMEREGISTRY__
  44. #include <NameRegistry.h>
  45. #endif
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. #if PRAGMA_IMPORT_SUPPORTED
  53. #pragma import on
  54. #endif
  55.  
  56. #if PRAGMA_ALIGN_SUPPORTED
  57. #pragma options align=mac68k
  58. #endif
  59.  
  60. #if FOR_SYSTEM8_PREEMPTIVE
  61. /*
  62. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  63.  
  64.     Low level (I/O architecture) interface
  65.     
  66. */
  67. /*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
  68. /*
  69. //------------------------------------------------------------------------------------
  70.  
  71.     Power Management usage monitoring.
  72.  
  73.     High level families call PMMonitorActivity for each hardware device they maintain.
  74.     Power management will periodically send messages to the family requesting the
  75.     current PMActivityInfo for each device.
  76.     If power management determines that a device is idle it may be taken off-line.
  77.     Prior to doing so power managment will send a message instructing the family to
  78.     prepare for the device being off-line. When the device is reqired again the family
  79.     uses PMMakeDeviceAvailable[Async] to instruct power management to bring the device 
  80.     back on-line.
  81.  
  82. */
  83. /*------------------------------------------------------------------------------------*/
  84. struct PMActivityInfo {
  85.     OptionBits                         flags;
  86.     UInt32                             requestCount;
  87. };
  88. typedef struct PMActivityInfo PMActivityInfo;
  89.  
  90. typedef struct OpaquePMMonitorRef* PMMonitorRef;
  91. extern OSStatus PMMonitorActivity(RegEntryRef *deviceToBeMonitored, ObjectID adminMessageObject, void *refCon, PMMonitorRef *newRef);
  92.  
  93. extern OSStatus PMStopMonitoring(PMMonitorRef ref);
  94.  
  95. /*
  96. //------------------------------------------------------------------------------------
  97.  
  98.     Device Power State Management
  99.     
  100.     If a family maintains a device which is capable of switching between multiple
  101.     power states, the family should inform power management of the device's
  102.     capabilities and wait for messages directing it to change the device's power
  103.     state.
  104.  
  105. */
  106. /*------------------------------------------------------------------------------------*/
  107.  
  108. enum {
  109.     kPMDeviceStateVersion        = 1
  110. };
  111.  
  112. typedef OSType PMDeviceStateID;
  113. typedef UInt32 PMDeviceStateFlags;
  114.  
  115. enum {
  116.     kPMDevicePoweredMask        = 0x0001,                        /* device powered vs. not */
  117.     kPMDeviceConfiguredMask        = 0x0002,                        /* internal configuration retained vs. not */
  118.     kPMDeviceUsableMask            = 0x0004,                        /* "on-line" vs "off-line" (usable or not) */
  119.     kPMDevicePowerLowestMask    = 0x0100,                        /* set for device's highest state */
  120.     kPMDevicePowerHighestMask    = 0x0200                        /* set for device's lowest state */
  121. };
  122.  
  123. struct PMDeviceState {
  124.     PMDeviceStateID                 id;                            /* state identifier - not interpreted by power management */
  125.     UInt32                             relativeConsumption;        /* relative ranking of power consumption */
  126.     PMDeviceStateFlags                 flags;                        /* one or more of the bits defined above */
  127. };
  128. typedef struct PMDeviceState PMDeviceState;
  129.  
  130. extern OSStatus PMManageDeviceState(RegEntryRef *deviceToBeManaged, ObjectID adminMessageObject, PBVersion deviceStateVersion, PMDeviceState *deviceStates, ItemCount numberOfStates, void *refCon);
  131.  
  132. extern OSStatus PMStopManagingDevice(RegEntryRef *deviceToStopManaging);
  133.  
  134. /*
  135. //------------------------------------------------------------------------------------
  136.  
  137.     Domain Power Level Management
  138.  
  139. */
  140. /*------------------------------------------------------------------------------------*/
  141.  
  142. enum {
  143.     kPMDomainLevelVersion        = 1
  144. };
  145.  
  146. typedef UInt32 PMDomainID;
  147. typedef UInt32 PMDomainLevel;
  148.  
  149. enum {
  150.     kPMDomainOff                = 0,
  151.     kPMDomainFreeze                = 1,
  152.     kPMDomainReduced            = 2,
  153.     kPMDomainFull                = 3,
  154.     kPMDomainReset                = 4                                /* Reset of the root domain is system restart */
  155. };
  156.  
  157. extern OSStatus PMManageDomainLevel(PMDomainID domainToBeManaged, ObjectID adminMessageObject, PBVersion domainLevelVersion, PMDomainLevel *domainLevels, ItemCount numberOfLevels, void *refCon);
  158.  
  159. extern OSStatus PMStopManagingDomain(PMDomainID domainToStopManaging);
  160.  
  161. /*
  162. //------------------------------------------------------------------------------------
  163.  
  164.     Power Management notification.
  165.     
  166.     Any entity in the I/O architecture can use these routines to be notified about
  167.     changes to device.
  168.     
  169.     Clients use a mask to specify which device aspects they are interested in and
  170.     also to specify when to be notified. Flags describing the new state are generated
  171.     and delivered with the notification.
  172.     
  173.     If the client is interested in power being removed and re-applied, they can request
  174.     it with (kPMNotifyAlwaysMask | kPMNotifyPowerMask). When the notification is 
  175.     delivered the client can check the new flags against kPMNotifyBeforeMask and
  176.     kPMNotifyAfterMask to determine if the change has already occured or not. And can
  177.     check against kPMDevicePoweredMask to determine if the device will have power or
  178.     not in the new state.
  179.     
  180. */
  181. /*------------------------------------------------------------------------------------*/
  182. typedef UInt32 PMNotifyFlags;
  183.  
  184. enum {
  185.     kPMNotifyPowerMask            = 0x00000001,
  186.     kPMNotifyConfigurationMask    = 0x00000002,
  187.     kPMNotifyUsabilityMask        = 0x00000004,
  188.     kPMNotifyAllMask            = 0x00000007,
  189.     kPMNotifyBeforeMask            = 0x40000000,                    /* notification sent before change */
  190.     kPMNotifyAfterMask            = 0x80000000,                    /* notification sent after change */
  191.     kPMNotifyAlwaysMask            = 0xC0000000                    /* notification sent before and after */
  192. };
  193.  
  194. typedef struct OpaquePMNotifyRef* PMNotifyRef;
  195. extern OSStatus PMNotifyStateChange(RegEntryRef *interestingDevice, ObjectID adminMessageObject, PMNotifyFlags notifyFlags, void *refCon, PMNotifyRef *newRef);
  196.  
  197. extern OSStatus PMStopNotification(PMNotifyRef ref);
  198.  
  199. /*
  200. //------------------------------------------------------------------------------------
  201.  
  202.     Power Management message
  203.     
  204.     This structure is used for all types of power management communication - usage
  205.     monitoring, state change notification, and state change commands.
  206.  
  207. */
  208. /*------------------------------------------------------------------------------------*/
  209.  
  210. enum {
  211.     kPMRetrieveActivityMessage    = 1,
  212.     kPMGetDeviceStateMessage    = 2,
  213.     kPMSetDeviceStateMessage    = 3,
  214.     kPMGetDomainLevelMessage    = 4,
  215.     kPMSetDomainLevelMessage    = 5,
  216.     kPMNotifyStateChangeMessage    = 6
  217. };
  218.  
  219. union PMMessageData {
  220.     PMDeviceStateID                 targetState;                /* used in kPMSetDeviceStateMessage */
  221.     PMDomainLevel                     targetLevel;                /* used in kPMSetDomainLevelMessage */
  222.     PMNotifyFlags                     newStateFlags;                /* used in kPMNotifyStateChangeMessage */
  223. };
  224. typedef union PMMessageData PMMessageData;
  225.  
  226. struct PMMessage {
  227.     UInt32                             ampReserved;                /* reserved for use by AdminMessagePort service */
  228.     UInt32                             messageCode;                /* one of the message codes above */
  229.     void *                            refCon;                        /* refCon passed to power management */
  230.     PMMessageData                     data;                        /* message-specific extra data (see above) */
  231. };
  232. typedef struct PMMessage PMMessage;
  233.  
  234. /*
  235. //------------------------------------------------------------------------------------
  236.  
  237.     Restoring an off-line or powered off device to a usable state.
  238.     
  239.     When a device that has been taken off-line or has had its power removed is needed
  240.     again, the following routine should be called. This routine will return when after
  241.     the device has been restored (or has failed to be restored). Part of the restoration
  242.     process is delivering notifications to interested parties - kPMPowerRestore and/or
  243.     kPMPrepareOnLine messages will be delivered and processed before this routine 
  244.     returns.
  245.  
  246. */
  247. /*------------------------------------------------------------------------------------*/
  248. extern OSStatus PMMakeDeviceAvailable(RegEntryRef *whichDevice);
  249.  
  250. extern OSStatus PMMakeDeviceAvailableAsync(RegEntryRef *whichDevice, KernelNotification *howToNotify);
  251.  
  252. extern OSStatus PMMakeDomainAvailable(PMDomainID whichDomain);
  253.  
  254. extern OSStatus PMMakeDomainAvailableAsync(PMDomainID whichDomain, KernelNotification *howToNotify);
  255.  
  256. /*
  257. //------------------------------------------------------------------------------------
  258.  
  259.     Disabling & Re-Enabling power managment of a device.
  260.     
  261.     Power management of a specific device can be disabled - this may be desirable
  262.     because of a resource reservation on some device. 
  263.     Families can implement a family specific API on top of this that can allow
  264.     an application to turn off power management for a particular volume or display
  265.     device.
  266.     
  267.     When power management of some device is disabled usage monitoring will still
  268.     occur, but there will not be any requests to change the device state. The
  269.     domain of which the device is a member will not be changed either.
  270.  
  271. */
  272. /*------------------------------------------------------------------------------------*/
  273. extern OSStatus PMDisablePowerManagement(RegEntryRef *whichDevice);
  274.  
  275. extern OSStatus PMEnablePowerManagement(RegEntryRef *whichDevice);
  276.  
  277. /*
  278. //------------------------------------------------------------------------------------
  279.  
  280.     Useful Name Registry names and constants.
  281.     
  282. */
  283. /*------------------------------------------------------------------------------------*/
  284.  
  285. #define kPowerDomainTree    "power-domain-tree"
  286.  
  287. /*
  288. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  289.  
  290.     High level (application) interface.
  291.     
  292. */
  293. /*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
  294. /*
  295.     Disk timer: the time a disk must be idle before it is spun down (or other
  296.     power management actions are taken). Applies to all disks, but each disk
  297.     has its own timer (one can stay spun up while the others are spun down).
  298.     
  299.     The minimum will be enforced.
  300.     
  301.     These API control system-wide parameters for the power management of disk devices.
  302.     For control over a specific disk see the <Block Storage or File System> API.
  303.     
  304.     
  305. */
  306.  
  307. enum {
  308.     kPMDiskSpinDownDisabled        = 0
  309. };
  310.  
  311. extern OSStatus PMSetDiskSpinDownTimeout(UInt32 seconds);
  312.  
  313. extern UInt32 PMGetDiskSpinDownTimeout(void );
  314.  
  315. extern UInt32 PMGetMinimumDiskSpinDownTimeout(void );
  316.  
  317. /*
  318.     Display timer: the period of time in which there has been no user input
  319.     before a display is dimmed or turned off. Applies to all displays, but
  320.     each display has its own timer.
  321.     
  322.     The minimum will be enforced.
  323. */
  324.  
  325. enum {
  326.     kPMDisplayDimmingDisabled    = 0
  327. };
  328.  
  329. extern OSStatus PMSetDisplayDimmingTimeout(UInt32 seconds);
  330.  
  331. extern UInt32 PMGetDisplayDimmingTimeout(void );
  332.  
  333. extern UInt32 PMGetMinimumDisplayDimmingTimeout(void );
  334.  
  335. /*
  336.     Idle state timer: the period of time in which all devices must be idle 
  337.     before the system is [?]. Basically, this is the timer for whatever action 
  338.     the user chose to happen when the system is idle. Could be sleep, hibernate,
  339.     or shutdown. If the user has explicitly disabled any action the    routines 
  340.     return an error.
  341.     
  342.     The minimum will be enforced and will be greater than or equal to the
  343.     maximum of disk spin down and display dimming times.
  344. */
  345.  
  346. enum {
  347.     kPMIdleStateDisabled        = 0
  348. };
  349.  
  350. extern OSStatus PMSetIdleStateTimeout(UInt32 seconds);
  351.  
  352. extern UInt32 PMGetIdleStateTimeout(void );
  353.  
  354. extern UInt32 PMGetMinimumIdleStateTimeout(void );
  355.  
  356. /*
  357.     Idle state: routines to get and set the action to be taken when power
  358.     management has determined that the system is idle.
  359.         Disabled: nothing happens when the machine is idle
  360.         Sleep is a soft definition - depends on the hardware: differs 
  361.         between portable and desktop systems.
  362.         Hibernate: save everthing and shutdown, on boot reload the saved
  363.         state.
  364.         Shutdown: just shutdown, nothing restored on boot.
  365. */
  366.  
  367. enum {
  368.     kPMIdleStateKindShutdown    = 1,
  369.     kPMIdleStateKindHibernate    = 2,
  370.     kPMIdleStateKindSleep        = 3
  371. };
  372.  
  373. extern OSStatus PMSetIdleStateKind(UInt32 idleStateKind);
  374.  
  375. extern UInt32 PMGetIdleStateKind(void );
  376.  
  377. /*
  378.     Misc. timers: These allow for programmable shutdown and power on. These are 
  379.     real absolute times - turn off at 6:00pm Jan 12 and back on at 8:00am Feb 1. 
  380.     The 'DateAndTimeSpec' is a made-up placeholder.
  381.     
  382.     Shutdown is a real shutdown.
  383.     IdleAction puts the machine into the chosen idle state - if the machine is
  384.     shutdown at the that time nothing happens.
  385.     PowerOn is either a normal boot or a return-from-idle depending on whether
  386.     the system is shutdown or is in its idle state.
  387. */
  388. #define kPMClearTime (ConstTimeObjectPtr) NULL
  389. extern OSStatus PMSetShutdownTime(ConstTimeObjectPtr when);
  390.  
  391. extern OSStatus PMGetShutdownTime(TimeObjectPtr when);
  392.  
  393. extern OSStatus PMSetIdleStateTime(ConstTimeObjectPtr when);
  394.  
  395. extern OSStatus PMGetIdleStateTime(TimeObjectPtr when);
  396.  
  397. extern OSStatus PMSetPowerOnTime(ConstTimeObjectPtr when);
  398.  
  399. extern OSStatus PMGetPowerOnTime(TimeObjectPtr when);
  400.  
  401. /*    Immediate control over system mode*/
  402. extern OSStatus PMRestart(void );
  403.  
  404. extern OSStatus PMShutdown(void );
  405.  
  406. extern OSStatus PMHibernate(void );
  407.  
  408. extern OSStatus PMSleep(void );
  409.  
  410. /*
  411. //------------------------------------------------------------------------------------
  412.  
  413.     Other high level API.
  414.     
  415.     Other families may want to implement their own power management API that is built
  416.     on top of the API presented here. Examples are the ability to turn off power
  417.     management of a specific storage volume or a specific graphics display. The battery
  418.     family will want/need to export a high level API that can show battery state.
  419.  
  420. */
  421. /*------------------------------------------------------------------------------------*/
  422. #endif
  423. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  424.  
  425. enum {
  426.                                                                 /* Bit positions for ModemByte */
  427.     modemOnBit                    = 0,
  428.     ringWakeUpBit                = 2,
  429.     modemInstalledBit            = 3,
  430.     ringDetectBit                = 4,
  431.     modemOnHookBit                = 5,                            /* masks for ModemByte */
  432.     modemOnMask                    = 0x01,
  433.     ringWakeUpMask                = 0x04,
  434.     modemInstalledMask            = 0x08,
  435.     ringDetectMask                = 0x10,
  436.     modemOnHookMask                = 0x20,                            /* bit positions for BatteryByte */
  437.     chargerConnBit                = 0,
  438.     hiChargeBit                    = 1,
  439.     chargeOverFlowBit            = 2,
  440.     batteryDeadBit                = 3,
  441.     batteryLowBit                = 4,
  442.     connChangedBit                = 5,                            /* masks for BatteryByte */
  443.     chargerConnMask                = 0x01,
  444.     hiChargeMask                = 0x02,
  445.     chargeOverFlowMask            = 0x04,
  446.     batteryDeadMask                = 0x08,
  447.     batteryLowMask                = 0x10,
  448.     connChangedMask                = 0x20,                            /* bit positions for SoundMixerByte */
  449.     MediaBaySndEnBit            = 0,
  450.     PCISndEnBit                    = 1,
  451.     ZVSndEnBit                    = 2,
  452.     PCCardSndEnBit                = 3,                            /* masks for SoundMixerByte */
  453.     MediaBaySndEnMask            = 0x01,
  454.     PCISndEnMask                = 0x02,
  455.     ZVSndEnMask                    = 0x04,
  456.     PCCardSndEnMask                = 0x08
  457. };
  458.  
  459.  
  460. enum {
  461.                                                                 /* commands to SleepQRec sleepQProc */
  462.     sleepRequest                = 1,
  463.     sleepDemand                    = 2,
  464.     sleepWakeUp                    = 3,
  465.     sleepRevoke                    = 4,
  466.     sleepUnlock                    = 4,
  467.     sleepDeny                    = 5,
  468.     sleepNow                    = 6,
  469.     dozeDemand                    = 7,
  470.     dozeWakeUp                    = 8,
  471.     dozeRequest                    = 9,                            /* SleepQRec.sleepQFlags */
  472.     noCalls                        = 1,
  473.     noRequest                    = 2,
  474.     slpQType                    = 16,
  475.     sleepQType                    = 16
  476. };
  477.  
  478. /* bits in bitfield returned by PMFeatures */
  479.  
  480. enum {
  481.     hasWakeupTimer                = 0,                            /* 1=wakeup timer is supported                        */
  482.     hasSharedModemPort            = 1,                            /* 1=modem port shared by SCC and internal modem    */
  483.     hasProcessorCycling            = 2,                            /* 1=processor cycling is supported                    */
  484.     mustProcessorCycle            = 3,                            /* 1=processor cycling should not be turned off        */
  485.     hasReducedSpeed                = 4,                            /* 1=processor can be started up at reduced speed    */
  486.     dynamicSpeedChange            = 5,                            /* 1=processor speed can be switched dynamically    */
  487.     hasSCSIDiskMode                = 6,                            /* 1=SCSI Disk Mode is supported                    */
  488.     canGetBatteryTime            = 7,                            /* 1=battery time can be calculated                    */
  489.     canWakeupOnRing                = 8,                            /* 1=can wakeup when the modem detects a ring        */
  490.     hasDimmingSupport            = 9,                            /* 1=has dimming support built in                    */
  491.     hasStartupTimer                = 10,                            /* 1=startup timer is supported                        */
  492.     hasDimLCDDownSupport        = 11,                            /* 1=supports dimming LCD to off even on dimMinAt1s    */
  493.     hasChargeNotification        = 11                            /* 1=client can determine of charge connect status change notifications available */
  494. };
  495.  
  496. /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */
  497.  
  498. enum {
  499.     hasInternalModem            = 0,                            /* 1=internal modem installed                        */
  500.     intModemRingDetect            = 1,                            /* 1=internal modem has detected a ring                */
  501.     intModemOffHook                = 2,                            /* 1=internal modem is off hook                        */
  502.     intModemRingWakeEnb            = 3,                            /* 1=wakeup on ring is enabled                        */
  503.     extModemSelected            = 4,                            /* 1=external modem selected                        */
  504.     modemSetBit                    = 15                            /* 1=set bit, 0=clear bit (SetIntModemState)        */
  505. };
  506.  
  507. /* bits in BatteryInfo.flags                                     */
  508. /* ("chargerConnected" doesn't mean the charger is plugged in)    */
  509.  
  510. enum {
  511.     batteryInstalled            = 7,                            /* 1=battery is currently connected                    */
  512.     batteryCharging                = 6,                            /* 1=battery is being charged                        */
  513.     chargerConnected            = 5                                /* 1=charger is connected to the PowerBook            */
  514. };
  515.  
  516.  
  517. enum {
  518.     HDPwrQType                    = 0x4844,                        /* 'HD' hard disk spindown queue element type            */
  519.     PMgrStateQType                = 0x504D                        /* 'PM' Power Manager state queue element type            */
  520. };
  521.  
  522. /* client notification bits in PMgrQueueElement.pmNotifyBits */
  523.  
  524. enum {
  525.     pmSleepTimeoutChanged        = 0,
  526.     pmSleepEnableChanged        = 1,
  527.     pmHardDiskTimeoutChanged    = 2,
  528.     pmHardDiskSpindownChanged    = 3,
  529.     pmDimmingTimeoutChanged        = 4,
  530.     pmDimmingEnableChanged        = 5,
  531.     pmDiskModeAddressChanged    = 6,
  532.     pmProcessorCyclingChanged    = 7,
  533.     pmProcessorSpeedChanged        = 8,
  534.     pmWakeupTimerChanged        = 9,
  535.     pmStartupTimerChanged        = 10,
  536.     pmHardDiskPowerRemovedbyUser = 11,
  537.     pmChargeStatusChanged        = 12
  538. };
  539.  
  540. /* System Activity Selectors */
  541.  
  542. enum {
  543.     OverallAct                    = 0,                            /* general type of activity                            */
  544.     UsrActivity                    = 1,                            /* user specific type of activity                    */
  545.     NetActivity                    = 2,                            /* network specific activity                        */
  546.     HDActivity                    = 3                                /* Hard Drive activity                                */
  547. };
  548.  
  549. /* Storage Media sleep mode defines */
  550.  
  551. enum {
  552.     kMediaModeOn                = 0,                            /* Media active (Drive spinning and at full power)    */
  553.     kMediaModeStandBy            = 1,                            /* Media standby (not implemented)    */
  554.     kMediaModeSuspend            = 2,                            /* Media Idle (not implemented)    */
  555.     kMediaModeOff                = 3                                /* Media Sleep (Drive not spinning and at min power, max recovery time)    */
  556. };
  557.  
  558.  
  559. enum {
  560.     kMediaPowerCSCode            = 70
  561. };
  562.  
  563. /* definitions for HDQueueElement.hdFlags    */
  564.  
  565. enum {
  566.     kHDQueuePostBit                = 0,                            /* 1 = call this routine on the second pass        */
  567.     kHDQueuePostMask            = (1 << kHDQueuePostBit)
  568. };
  569.  
  570. struct ActivityInfo {
  571.     short                             ActivityType;                /* Type of activity to be fetched.  Same as UpdateSystemActivity Selectors */
  572.     unsigned long                     ActivityTime;                /* Time of last activity (in ticks) of specified type. */
  573. };
  574. typedef struct ActivityInfo ActivityInfo;
  575.  
  576. /* information returned by GetScaledBatteryInfo */
  577. struct BatteryInfo {
  578.     UInt8                             flags;                        /* misc flags (see below)                            */
  579.     UInt8                             warningLevel;                /* scaled warning level (0-255)                        */
  580.     UInt8                             reserved;                    /* reserved for internal use                        */
  581.     UInt8                             batteryLevel;                /* scaled battery level (0-255)                        */
  582. };
  583. typedef struct BatteryInfo BatteryInfo;
  584.  
  585. typedef SInt8 ModemByte;
  586. typedef SInt8 BatteryByte;
  587. typedef SInt8 SoundMixerByte;
  588. typedef long PMResultCode;
  589. typedef struct SleepQRec SleepQRec;
  590. typedef SleepQRec *SleepQRecPtr;
  591. typedef struct HDQueueElement HDQueueElement;
  592. typedef struct PMgrQueueElement PMgrQueueElement;
  593. /*
  594.         This ProcPtr uses register based parameters on the 68k and cannot
  595.         be written in or called from a high-level language without the help of
  596.         mixed mode or assembly glue.
  597.  
  598.             typedef pascal long (*SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
  599.  
  600. */
  601. typedef pascal void (*HDSpindownProcPtr)(HDQueueElement *theElement);
  602. typedef pascal void (*PMgrStateChangeProcPtr)(PMgrQueueElement *theElement, long stateBits);
  603.  
  604. #if GENERATINGCFM
  605. typedef UniversalProcPtr SleepQUPP;
  606. typedef UniversalProcPtr HDSpindownUPP;
  607. typedef UniversalProcPtr PMgrStateChangeUPP;
  608. #else
  609. typedef Register68kProcPtr SleepQUPP;
  610. typedef HDSpindownProcPtr HDSpindownUPP;
  611. typedef PMgrStateChangeProcPtr PMgrStateChangeUPP;
  612. #endif
  613. struct SleepQRec {
  614.     SleepQRecPtr                     sleepQLink;                    /* pointer to next queue element                */
  615.     short                             sleepQType;                    /* queue element type (must be SleepQType)        */
  616.     SleepQUPP                         sleepQProc;                    /* pointer to sleep universal proc ptr            */
  617.     short                             sleepQFlags;                /* flags                                        */
  618. };
  619.  
  620. struct HDQueueElement {
  621.     struct HDQueueElement *            hdQLink;                    /* pointer to next queue element                */
  622.     short                             hdQType;                    /* queue element type (must be HDPwrQType)        */
  623.     short                             hdFlags;                    /* miscellaneous flags                            */
  624.     HDSpindownUPP                     hdProc;                        /* pointer to routine to call                    */
  625.     long                             hdUser;                        /* user-defined (variable storage, etc.)        */
  626. };
  627.  
  628. struct PMgrQueueElement {
  629.     struct PMgrQueueElement *        pmQLink;                    /* pointer to next queue element                */
  630.     short                             pmQType;                    /* queue element type (must be PMgrStateQType)    */
  631.     short                             pmFlags;                    /* miscellaneous flags                            */
  632.     long                             pmNotifyBits;                /* bitmap of which changes to be notified for    */
  633.     PMgrStateChangeUPP                 pmProc;                        /* pointer to routine to call                    */
  634.     long                             pmUser;                        /* user-defined (variable storage, etc.)        */
  635. };
  636.  
  637. struct BatteryTimeRec {
  638.     unsigned long                     expectedBatteryTime;        /* estimated battery time remaining (seconds)    */
  639.     unsigned long                     minimumBatteryTime;            /* minimum battery time remaining (seconds)        */
  640.     unsigned long                     maximumBatteryTime;            /* maximum battery time remaining (seconds)        */
  641.     unsigned long                     timeUntilCharged;            /* time until battery is fully charged (seconds)*/
  642. };
  643. typedef struct BatteryTimeRec BatteryTimeRec;
  644.  
  645. struct WakeupTime {
  646.     unsigned long                     wakeTime;                    /* wakeup time (same format as current time)        */
  647.     Boolean                         wakeEnabled;                /* 1=enable wakeup timer, 0=disable wakeup timer    */
  648.     SInt8                             filler;
  649. };
  650. typedef struct WakeupTime WakeupTime;
  651.  
  652. struct StartupTime {
  653.     unsigned long                     startTime;                    /* startup time (same format as current time)        */
  654.     Boolean                         startEnabled;                /* 1=enable startup timer, 0=disable startup timer    */
  655.     SInt8                             filler;
  656. };
  657. typedef struct StartupTime StartupTime;
  658.  
  659. extern pascal OSErr DisableWUTime(void );
  660.  
  661. extern pascal OSErr SetWUTime(long WUTime);
  662.  
  663. extern pascal OSErr GetWUTime(long *WUTime, Byte *WUFlag);
  664.  
  665. extern pascal OSErr BatteryStatus(Byte *Status, Byte *Power);
  666.  
  667. extern pascal OSErr ModemStatus(Byte *Status);
  668.  
  669.  
  670. #if GENERATING68K && !GENERATINGCFM
  671. #pragma parameter __D0 IdleUpdate
  672. #endif
  673. extern pascal long IdleUpdate(void )
  674.  ONEWORDINLINE(0xA285);
  675.  
  676.  
  677. #if GENERATING68K && !GENERATINGCFM
  678. #pragma parameter __D0 GetCPUSpeed
  679. #endif
  680. extern pascal long GetCPUSpeed(void )
  681.  TWOWORDINLINE(0x70FF, 0xA485);
  682.  
  683. extern pascal void EnableIdle(void )
  684.  TWOWORDINLINE(0x7000, 0xA485);
  685.  
  686. extern pascal void DisableIdle(void )
  687.  TWOWORDINLINE(0x7001, 0xA485);
  688.  
  689.  
  690. #if GENERATING68K && !GENERATINGCFM
  691. #pragma parameter SleepQInstall(__A0)
  692. #endif
  693. extern pascal void SleepQInstall(SleepQRecPtr qRecPtr)
  694.  ONEWORDINLINE(0xA28A);
  695.  
  696.  
  697. #if GENERATING68K && !GENERATINGCFM
  698. #pragma parameter SleepQRemove(__A0)
  699. #endif
  700. extern pascal void SleepQRemove(SleepQRecPtr qRecPtr)
  701.  ONEWORDINLINE(0xA48A);
  702.  
  703. extern pascal void AOn(void )
  704.  TWOWORDINLINE(0x7004, 0xA685);
  705.  
  706. extern pascal void AOnIgnoreModem(void )
  707.  TWOWORDINLINE(0x7005, 0xA685);
  708.  
  709. extern pascal void BOn(void )
  710.  TWOWORDINLINE(0x7000, 0xA685);
  711.  
  712. extern pascal void AOff(void )
  713.  TWOWORDINLINE(0x7084, 0xA685);
  714.  
  715. extern pascal void BOff(void )
  716.  TWOWORDINLINE(0x7080, 0xA685);
  717.  
  718. /* Public Power Management API (NEW!) */
  719.  
  720. #if GENERATING68K && !GENERATINGCFM
  721. #pragma parameter __D0 PMSelectorCount
  722. #endif
  723. extern pascal short PMSelectorCount(void )
  724.  TWOWORDINLINE(0x7000, 0xA09E);
  725.  
  726.  
  727. #if GENERATING68K && !GENERATINGCFM
  728. #pragma parameter __D0 PMFeatures
  729. #endif
  730. extern pascal unsigned long PMFeatures(void )
  731.  TWOWORDINLINE(0x7001, 0xA09E);
  732.  
  733.  
  734. #if GENERATING68K && !GENERATINGCFM
  735. #pragma parameter __D0 GetSleepTimeout
  736. #endif
  737. extern pascal UInt8 GetSleepTimeout(void )
  738.  TWOWORDINLINE(0x7002, 0xA09E);
  739.  
  740.  
  741. #if GENERATING68K && !GENERATINGCFM
  742. #pragma parameter SetSleepTimeout(__D0)
  743. #endif
  744. extern pascal void SetSleepTimeout(UInt8 timeout)
  745.  FOURWORDINLINE(0x4840, 0x303C, 0x0003, 0xA09E);
  746.  
  747.  
  748. #if GENERATING68K && !GENERATINGCFM
  749. #pragma parameter __D0 GetHardDiskTimeout
  750. #endif
  751. extern pascal UInt8 GetHardDiskTimeout(void )
  752.  TWOWORDINLINE(0x7004, 0xA09E);
  753.  
  754.  
  755. #if GENERATING68K && !GENERATINGCFM
  756. #pragma parameter SetHardDiskTimeout(__D0)
  757. #endif
  758. extern pascal void SetHardDiskTimeout(UInt8 timeout)
  759.  FOURWORDINLINE(0x4840, 0x303C, 0x0005, 0xA09E);
  760.  
  761.  
  762. #if GENERATING68K && !GENERATINGCFM
  763. #pragma parameter __D0 HardDiskPowered
  764. #endif
  765. extern pascal Boolean HardDiskPowered(void )
  766.  TWOWORDINLINE(0x7006, 0xA09E);
  767.  
  768.  
  769. #if GENERATING68K && !GENERATINGCFM
  770. #pragma parameter SpinDownHardDisk
  771. #endif
  772. extern pascal void SpinDownHardDisk(void )
  773.  TWOWORDINLINE(0x7007, 0xA09E);
  774.  
  775.  
  776. #if GENERATING68K && !GENERATINGCFM
  777. #pragma parameter __D0 IsSpindownDisabled
  778. #endif
  779. extern pascal Boolean IsSpindownDisabled(void )
  780.  TWOWORDINLINE(0x7008, 0xA09E);
  781.  
  782.  
  783. #if GENERATING68K && !GENERATINGCFM
  784. #pragma parameter SetSpindownDisable(__D0)
  785. #endif
  786. extern pascal void SetSpindownDisable(Boolean setDisable)
  787.  FOURWORDINLINE(0x4840, 0x303C, 0x0009, 0xA09E);
  788.  
  789.  
  790. #if GENERATING68K && !GENERATINGCFM
  791. #pragma parameter __D0 HardDiskQInstall(__A0)
  792. #endif
  793. extern pascal OSErr HardDiskQInstall(HDQueueElement *theElement)
  794.  TWOWORDINLINE(0x700A, 0xA09E);
  795.  
  796.  
  797. #if GENERATING68K && !GENERATINGCFM
  798. #pragma parameter __D0 HardDiskQRemove(__A0)
  799. #endif
  800. extern pascal OSErr HardDiskQRemove(HDQueueElement *theElement)
  801.  TWOWORDINLINE(0x700B, 0xA09E);
  802.  
  803.  
  804. #if GENERATING68K && !GENERATINGCFM
  805. #pragma parameter GetScaledBatteryInfo(__D0, __A0)
  806. #endif
  807. extern pascal void GetScaledBatteryInfo(short whichBattery, BatteryInfo *theInfo)
  808.  FIVEWORDINLINE(0x4840, 0x303C, 0x000C, 0xA09E, 0x2080);
  809.  
  810.  
  811. #if GENERATING68K && !GENERATINGCFM
  812. #pragma parameter AutoSleepControl(__D0)
  813. #endif
  814. extern pascal void AutoSleepControl(Boolean enableSleep)
  815.  FOURWORDINLINE(0x4840, 0x303C, 0x000D, 0xA09E);
  816.  
  817.  
  818. #if GENERATING68K && !GENERATINGCFM
  819. #pragma parameter __D0 GetIntModemInfo
  820. #endif
  821. extern pascal unsigned long GetIntModemInfo(void )
  822.  TWOWORDINLINE(0x700E, 0xA09E);
  823.  
  824.  
  825. #if GENERATING68K && !GENERATINGCFM
  826. #pragma parameter SetIntModemState(__D0)
  827. #endif
  828. extern pascal void SetIntModemState(short theState)
  829.  FOURWORDINLINE(0x4840, 0x303C, 0x000F, 0xA09E);
  830.  
  831.  
  832. #if GENERATING68K && !GENERATINGCFM
  833. #pragma parameter __D0 MaximumProcessorSpeed
  834. #endif
  835. extern pascal short MaximumProcessorSpeed(void )
  836.  TWOWORDINLINE(0x7010, 0xA09E);
  837.  
  838.  
  839. #if GENERATING68K && !GENERATINGCFM
  840. #pragma parameter __D0 CurrentProcessorSpeed
  841. #endif
  842. extern pascal short CurrentProcessorSpeed(void )
  843.  TWOWORDINLINE(0x7011, 0xA09E);
  844.  
  845.  
  846. #if GENERATING68K && !GENERATINGCFM
  847. #pragma parameter __D0 FullProcessorSpeed
  848. #endif
  849. extern pascal Boolean FullProcessorSpeed(void )
  850.  TWOWORDINLINE(0x7012, 0xA09E);
  851.  
  852.  
  853. #if GENERATING68K && !GENERATINGCFM
  854. #pragma parameter __D0 SetProcessorSpeed(__D0)
  855. #endif
  856. extern pascal Boolean SetProcessorSpeed(Boolean fullSpeed)
  857.  FOURWORDINLINE(0x4840, 0x303C, 0x0013, 0xA09E);
  858.  
  859.  
  860. #if GENERATING68K && !GENERATINGCFM
  861. #pragma parameter __D0 GetSCSIDiskModeAddress
  862. #endif
  863. extern pascal short GetSCSIDiskModeAddress(void )
  864.  TWOWORDINLINE(0x7014, 0xA09E);
  865.  
  866.  
  867. #if GENERATING68K && !GENERATINGCFM
  868. #pragma parameter SetSCSIDiskModeAddress(__D0)
  869. #endif
  870. extern pascal void SetSCSIDiskModeAddress(short scsiAddress)
  871.  FOURWORDINLINE(0x4840, 0x303C, 0x0015, 0xA09E);
  872.  
  873.  
  874. #if GENERATING68K && !GENERATINGCFM
  875. #pragma parameter GetWakeupTimer(__A0)
  876. #endif
  877. extern pascal void GetWakeupTimer(WakeupTime *theTime)
  878.  TWOWORDINLINE(0x7016, 0xA09E);
  879.  
  880.  
  881. #if GENERATING68K && !GENERATINGCFM
  882. #pragma parameter SetWakeupTimer(__A0)
  883. #endif
  884. extern pascal void SetWakeupTimer(WakeupTime *theTime)
  885.  TWOWORDINLINE(0x7017, 0xA09E);
  886.  
  887.  
  888. #if GENERATING68K && !GENERATINGCFM
  889. #pragma parameter __D0 IsProcessorCyclingEnabled
  890. #endif
  891. extern pascal Boolean IsProcessorCyclingEnabled(void )
  892.  TWOWORDINLINE(0x7018, 0xA09E);
  893.  
  894.  
  895. #if GENERATING68K && !GENERATINGCFM
  896. #pragma parameter EnableProcessorCycling(__D0)
  897. #endif
  898. extern pascal void EnableProcessorCycling(Boolean enable)
  899.  FOURWORDINLINE(0x4840, 0x303C, 0x0019, 0xA09E);
  900.  
  901.  
  902. #if GENERATING68K && !GENERATINGCFM
  903. #pragma parameter __D0 BatteryCount
  904. #endif
  905. extern pascal short BatteryCount(void )
  906.  TWOWORDINLINE(0x701A, 0xA09E);
  907.  
  908.  
  909. #if GENERATING68K && !GENERATINGCFM
  910. #pragma parameter __D0 GetBatteryVoltage(__D0)
  911. #endif
  912. extern pascal Fixed GetBatteryVoltage(short whichBattery)
  913.  FOURWORDINLINE(0x4840, 0x303C, 0x001B, 0xA09E);
  914.  
  915.  
  916. #if GENERATING68K && !GENERATINGCFM
  917. #pragma parameter GetBatteryTimes(__D0, __A0)
  918. #endif
  919. extern pascal void GetBatteryTimes(short whichBattery, BatteryTimeRec *theTimes)
  920.  FOURWORDINLINE(0x4840, 0x303C, 0x001C, 0xA09E);
  921.  
  922.  
  923. #if GENERATING68K && !GENERATINGCFM
  924. #pragma parameter __D0 GetDimmingTimeout
  925. #endif
  926. extern pascal UInt8 GetDimmingTimeout(void )
  927.  TWOWORDINLINE(0x701D, 0xA09E);
  928.  
  929.  
  930. #if GENERATING68K && !GENERATINGCFM
  931. #pragma parameter SetDimmingTimeout(__D0)
  932. #endif
  933. extern pascal void SetDimmingTimeout(UInt8 timeout)
  934.  FOURWORDINLINE(0x4840, 0x303C, 0x001E, 0xA09E);
  935.  
  936.  
  937. #if GENERATING68K && !GENERATINGCFM
  938. #pragma parameter DimmingControl(__D0)
  939. #endif
  940. extern pascal void DimmingControl(Boolean enableSleep)
  941.  FOURWORDINLINE(0x4840, 0x303C, 0x001F, 0xA09E);
  942.  
  943.  
  944. #if GENERATING68K && !GENERATINGCFM
  945. #pragma parameter __D0 IsDimmingControlDisabled
  946. #endif
  947. extern pascal Boolean IsDimmingControlDisabled(void )
  948.  TWOWORDINLINE(0x7020, 0xA09E);
  949.  
  950.  
  951. #if GENERATING68K && !GENERATINGCFM
  952. #pragma parameter __D0 IsAutoSlpControlDisabled
  953. #endif
  954. extern pascal Boolean IsAutoSlpControlDisabled(void )
  955.  TWOWORDINLINE(0x7021, 0xA09E);
  956.  
  957.  
  958. #if GENERATING68K && !GENERATINGCFM
  959. #pragma parameter __D0 PMgrStateQInstall(__A0)
  960. #endif
  961. extern pascal OSErr PMgrStateQInstall(PMgrQueueElement *theElement)
  962.  TWOWORDINLINE(0x7022, 0xA09E);
  963.  
  964.  
  965. #if GENERATING68K && !GENERATINGCFM
  966. #pragma parameter __D0 PMgrStateQRemove(__A0)
  967. #endif
  968. extern pascal OSErr PMgrStateQRemove(PMgrQueueElement *theElement)
  969.  TWOWORDINLINE(0x7023, 0xA09E);
  970.  
  971.  
  972. #if GENERATING68K && !GENERATINGCFM
  973. #pragma parameter __D0 UpdateSystemActivity(__D0)
  974. #endif
  975. extern pascal OSErr UpdateSystemActivity(UInt8 activity)
  976.  FOURWORDINLINE(0x4840, 0x303C, 0x0024, 0xA09E);
  977.  
  978.  
  979. #if GENERATING68K && !GENERATINGCFM
  980. #pragma parameter __D0 DelaySystemIdle
  981. #endif
  982. extern pascal OSErr DelaySystemIdle(void )
  983.  TWOWORDINLINE(0x7025, 0xA09E);
  984.  
  985.  
  986. #if GENERATING68K && !GENERATINGCFM
  987. #pragma parameter __D0 GetStartupTimer(__A0)
  988. #endif
  989. extern pascal OSErr GetStartupTimer(StartupTime *theTime)
  990.  TWOWORDINLINE(0x7026, 0xA09E);
  991.  
  992.  
  993. #if GENERATING68K && !GENERATINGCFM
  994. #pragma parameter __D0 SetStartupTimer(__A0)
  995. #endif
  996. extern pascal OSErr SetStartupTimer(StartupTime *theTime)
  997.  TWOWORDINLINE(0x7027, 0xA09E);
  998.  
  999.  
  1000. #if GENERATING68K && !GENERATINGCFM
  1001. #pragma parameter __D0 GetLastActivity(__A0)
  1002. #endif
  1003. extern pascal OSErr GetLastActivity(ActivityInfo *theActivity)
  1004.  TWOWORDINLINE(0x7028, 0xA09E);
  1005.  
  1006.  
  1007. #if GENERATING68K && !GENERATINGCFM
  1008. #pragma parameter __D0 GetSoundMixerState(__A0)
  1009. #endif
  1010. extern pascal OSErr GetSoundMixerState(SoundMixerByte *theSoundMixerByte)
  1011.  TWOWORDINLINE(0x7029, 0xA09E);
  1012.  
  1013.  
  1014. #if GENERATING68K && !GENERATINGCFM
  1015. #pragma parameter __D0 SetSoundMixerState(__A0)
  1016. #endif
  1017. extern pascal OSErr SetSoundMixerState(SoundMixerByte *theSoundMixerByte)
  1018.  TWOWORDINLINE(0x702A, 0xA09E);
  1019.  
  1020.  
  1021. #if GENERATING68K && !GENERATINGCFM
  1022. #pragma parameter __D0 GetDimLCDDownState
  1023. #endif
  1024. extern pascal Boolean GetDimLCDDownState(void )
  1025.  TWOWORDINLINE(0x702B, 0xA09E);
  1026.  
  1027.  
  1028. #if GENERATING68K && !GENERATINGCFM
  1029. #pragma parameter SetDimLCDDownState(__D0)
  1030. #endif
  1031. extern pascal void SetDimLCDDownState(Boolean dimLCDDownState)
  1032.  FOURWORDINLINE(0x4840, 0x303C, 0x002C, 0xA09E);
  1033.  
  1034.  
  1035. enum {
  1036.     uppSleepQProcInfo = kRegisterBased
  1037.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  1038.          | REGISTER_RESULT_LOCATION(kRegisterD0)
  1039.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(long)))
  1040.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(SleepQRecPtr))),
  1041.     uppHDSpindownProcInfo = kPascalStackBased
  1042.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(HDQueueElement *))),
  1043.     uppPMgrStateChangeProcInfo = kPascalStackBased
  1044.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(PMgrQueueElement *)))
  1045.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1046. };
  1047.  
  1048. #if GENERATINGCFM
  1049. #define NewSleepQProc(userRoutine)        \
  1050.         (SleepQUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentArchitecture())
  1051. #define NewHDSpindownProc(userRoutine)        \
  1052.         (HDSpindownUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppHDSpindownProcInfo, GetCurrentArchitecture())
  1053. #define NewPMgrStateChangeProc(userRoutine)        \
  1054.         (PMgrStateChangeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPMgrStateChangeProcInfo, GetCurrentArchitecture())
  1055. #else
  1056. #define NewSleepQProc(userRoutine)        \
  1057.         ((SleepQUPP) (userRoutine))
  1058. #define NewHDSpindownProc(userRoutine)        \
  1059.         ((HDSpindownUPP) (userRoutine))
  1060. #define NewPMgrStateChangeProc(userRoutine)        \
  1061.         ((PMgrStateChangeUPP) (userRoutine))
  1062. #endif
  1063.  
  1064. #if GENERATINGCFM
  1065. #define CallSleepQProc(userRoutine, message, qRecPtr)        \
  1066.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSleepQProcInfo, (message), (qRecPtr))
  1067. #define CallHDSpindownProc(userRoutine, theElement)        \
  1068.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppHDSpindownProcInfo, (theElement))
  1069. #define CallPMgrStateChangeProc(userRoutine, theElement, stateBits)        \
  1070.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPMgrStateChangeProcInfo, (theElement), (stateBits))
  1071. #else
  1072. /* (*SleepQUPP) cannot be called from a high-level language without the Mixed Mode Manager */
  1073. #define CallHDSpindownProc(userRoutine, theElement)        \
  1074.         (*(userRoutine))((theElement))
  1075. #define CallPMgrStateChangeProc(userRoutine, theElement, stateBits)        \
  1076.         (*(userRoutine))((theElement), (stateBits))
  1077. #endif
  1078. #endif
  1079.  
  1080. #if PRAGMA_ALIGN_SUPPORTED
  1081. #pragma options align=reset
  1082. #endif
  1083.  
  1084. #if PRAGMA_IMPORT_SUPPORTED
  1085. #pragma import off
  1086. #endif
  1087.  
  1088. #ifdef __cplusplus
  1089. }
  1090. #endif
  1091.  
  1092. #endif /* __POWER__ */
  1093.  
  1094.